﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity.Migrations; // have to be added, VS can't find on its own
using _1._6._2015_EF_Pair.Data.Model;

namespace _1._6._2015_EF_Pair.Data
{
    public static class Seeder
    {

        public static void Seed(PersonsDBContext db)
        {
            db.Persons.AddOrUpdate(p => new {p.FirstName, p.LastName},
                new Person 
                {
                    FirstName = "Louis",
                    LastName = "Murphy"
                },
            new Person 
                {
                    FirstName = "Shelbu",
                    LastName = "Murphy"
                },
            new Person 
                {
                    FirstName = "Jettin",
                    LastName = "Murphy"
                },
            new Person 
                {
                    FirstName = "Maverick",
                    LastName = "Murphy"
                }
                );
            db.SaveChanges();
        }

    }
}
